package com.allen.study.common.constant;

import lombok.Getter;

@Getter
public enum EducationEnum {
    JUNIOR(0,"初中及以下"),
    SENIOR(1,"高中"),
    REGULAR(2,"本科"),
    MASTER(3,"硕士"),
    DOCTOR(4,"博士"),

            ;



    private Integer code;
    private String desc;


    EducationEnum(Integer code,String desc){
        this.code = code;
        this.desc = desc;
    }


    public static EducationEnum getInstance(Integer code) {
        for (EducationEnum value : EducationEnum.values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }

}
